/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package vek.Objects;

import java.util.ArrayList;
import vek.XML.parsedObjects.ParsedRestaurant;

/**
 * A Restaurant POI.
 * This class has a types of food sold.
 * @author Christian, Michal og Jakob (Hold1, gruppe 2)
 */
public class Restaurant extends POIComercial
{
    
    protected ArrayList<String> typesOfFoodSold;
    
    /**
     * Creates a Resturant object and assigns its varaibles using data from the corrosponding ParsedObject.
     * @param pr the ParsedRestaurant which contains the data from the XML files which this object is based on.
     */
    
    public Restaurant(ParsedRestaurant pr)
    {
        super(pr.parsedComercial);
        typesOfFoodSold = pr.typesOfFoodSold;
    }
    
    @Override
    public String toString()
    {
        String s = super.toString();
        return s;
    }
    
    public ArrayList<String> getTypesOfFoodSold()
    {
        return typesOfFoodSold;
    }
    
    public boolean hasTypesOfFoodStartsWith(String s)
    {
        for(int i = 0; i < typesOfFoodSold.size(); i++)
        {
            if(typesOfFoodSold.get(i).startsWith(s))
            {
                return true;
            }
        }
        return false;
    }
    
    

}
